﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Passion3DProject.src.Models_s_Classes
{
    static class Colision
    {
        public static bool ObjectColision(Player player, List<GameObject> objectList)
        {
            foreach (GameObject obj in objectList)
            {
                if (player.FutureCollisionBox.Intersects(obj.CollisionBox))
                {
                    return true;
                }
            }

            return false;
        }

        public static bool ItemColision(Player player,List<Item> ItensList)
        {
            foreach (Item Item in ItensList)
            {
                if (player.CollisionBox.Intersects(Item.CollisionBox))
                {
                    return true;
                }
            }
            return false;
        }

        public static bool ColisionFront(Player player, List<GameObject> objList)
        {
            foreach (GameObject obj in objList)
            {
                if (player.CollisionBox.Min.Z <= obj.CollisionBox.Max.Z)
                {
                    return true;
                }
            }
            return false;
        }
    }
}
